package com.ruoyi.baseData.controller;

import com.ruoyi.baseData.domain.dto.EquipmentConfigDto;
import com.ruoyi.baseData.service.EquipmentConfigService;
import com.ruoyi.common.core.domain.R;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/equipmentConfig")
public class EquipmentConfigController {
    @Autowired
    EquipmentConfigService equipmentConfigService;

    @PostMapping("/getEquipmentConfigByPage")
    public R export(@RequestBody EquipmentConfigDto materialDto)
    {
        return R.ok(equipmentConfigService.getEquipmentConfigByPage(materialDto));
    }

    @PostMapping("/addEquipmentConfig")
    public R addTest(@RequestBody EquipmentConfigDto materialDto){
        equipmentConfigService.addEquipmentConfig(materialDto);
        return R.ok("添加成功");
    }

    @PostMapping("/delEquipmentConfig")
    public R delTest(@RequestBody EquipmentConfigDto materialDto){
        equipmentConfigService.delEquipmentConfig(materialDto);
        return R.ok("删除成功");
    }

    @PostMapping("/updateEquipmentConfig")
    public R updateTest(@RequestBody EquipmentConfigDto materialDto){
        equipmentConfigService.updateEquipmentConfig(materialDto);
        return R.ok("锁定成功");
    }

}
